"""
常量文件
"""
import os
from enum import Enum

from utils.path import get_file_path, get_temp_path

# 配置文件的远程地址
BLACKLIST_URL = "https://gitee.com/nan-plant/sharing-net/raw/master/conf_files/blacklist.txt"
WHITELIST_URL = "https://gitee.com/nan-plant/sharing-net/raw/master/conf_files/whitelist.txt"
CONFIG_URL = "https://gitee.com/nan-plant/sharing-net/raw/master/conf_files/conf.yml"
NEW_VERSION_URL = "https://gitee.com/nan-plant/sharing-net/raw/master/conf_files/version.json"


# 几个常用路径，方便即引即用
LOCAL_VERSION_PATH = get_file_path(r"conf_files\version.json")
LOGO_PATH = get_file_path(r"resources\logo.ico")
SETTING_FOLDER = os.path.join(get_temp_path(), "SharingNet", "setting")
LOG_FOLDER = os.path.join(get_temp_path(), "SharingNet", "log")

# 一些不需要处理的域名
BlockList = [".*events.data.*", "blank"]


class Http(Enum):
    """定义http的几种请求方法"""
    MethodGet = "GET"
    MethodHead = "HEAD"
    MethodPost = "POST"
    MethodPut = "PUT"
    MethodPatch = "PATCH"
    MethodDelete = "DELETE"
    MethodConnect = "CONNECT"
    MethodOptions = "OPTIONS"
    MethodTrace = "TRACE"
